/**
 *  距离下一个小时距离毫秒数
 * @param date 不能为空
 * @returns {number}
 */
export function getDelayToNextHour(date?: Date | null) {
  if (date == null) date = new Date()
  const minute = date.getMinutes()
  const second = date.getSeconds()
  const millisecond = date.getMilliseconds()
  return 60 * 60 * 1000 - (minute * 60 + second) * 1000 - millisecond
}
